package org.lex.elec.apps;

import org.apache.log4j.Logger;
import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationActionMap;
import org.jdesktop.application.ApplicationContext;

/**
 * A - Application type<br>
 * V - View type
 * 
 * @param <A>
 * @param <V>
 */
public abstract class AbstractController<A extends Application, V> {
	private final A application;
	protected final Logger log = Logger.getLogger(getClass());
	private final V view;

	protected AbstractController(A application, V view) {
		this.application = application;
		this.view = view;
	}

	public A getApplication() {
		return application;
	}

	public ApplicationContext getContext() {
		return this.getApplication().getContext();
	}

	public V getView() {
		return view;
	}

	protected ApplicationActionMap getActionMap() {
		return this.getApplication().getContext().getActionMap();
	}
}